<template>
	<view>
		<my-head title="慧人才"></my-head>
		<view class="content">
			<view class="con-pc">
				<image src="/static/image/my/pc.png" class="imgecr"></image>
				<view class="sub">登录确认</view>
				<view class="text">信息将会同步到本地</view>
			</view>
			<view @click="onsubmit" class="btn" >确认登录
			</view>
			<view @click="oncell" class="btn1" >取消登录
			</view>
		</view>

	</view>
</template>

<script>
	import myHead from '@/pages/component/baseHead.vue'

	export default {
		data() {
			return {
				CacheKey: ''
			}
		},
		//子组件
		components: {
			myHead
		},
		onLoad(option) {
			if (option) {
				this.CacheKey = option.CacheKey
			}

		},
		methods: {
			onsubmit() {
				let datas = {
					CacheKey: this.CacheKey,
				}
				console.log(datas);
				this.$http.core.scancodelogin(datas).then(res => {
					if (res.Success) {
						this.$util.toast("登录成功")
						setTimeout(() => {
							uni.navigateBack()
						}, 500)
					}
				})
			},
			oncell() {
				let datass = {
					CacheKey: this.CacheKey,
				}
				console.log(datass);
				this.$http.core.scancodecancel(datass).then(res => {
					this.$util.toast("取消登录")
					setTimeout(() => {
						uni.navigateBack()
					}, 500)
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	page {
		background-color: #fff;
	}

	.content {
		text-align: center;
		margin-top: 20%;

		.con-pc {
			margin: 30rpx;

			.imgecr {
				width: 200rpx;
				height: 180rpx;
				margin: 30rpx 0;
			}

			.sub {
				font-size: 28rpx;
				font-weight: 600;
			}

			.text {
				color: #999;
				font-size: 28rpx;
				margin: 10rpx;
			}
		}

		.btn {
			background-color: #1684FC;
			color: #fff;
			margin: 100rpx 30% 40rpx 30%;
			padding: 10px;
			background-color: rgb(0, 170, 255);
			border-radius: 10rpx;
		}

		.btn1 {
			color: #999;
			font-size: 26rpx;
			padding: 20rpx;
		}
	}
</style>
